<?php
namespace app\activity\model;
use think\Model;
class Manager extends Model{
    protected $table = 'bk_manager';
    protected $autoWriteTimestamp = 'datetime';
    public function saveManager($data){
        $isReg = self::where('user_id',$data['user_id'])->find();
        if(!$isReg){
            $result = self::create($data);
        }else{
            $result = self::where('id', $isReg->id)->update($data);
        }
        return $result;
    }

/*    public function getInfo($userId){
        return self::where('user_id',$userId)->find();
    }*/
    public function getInfo($where){
        return self::where($where)->find();
    }
    public function getValue($where,$column='id'){
        return self::where($where)->value($column);
    }
}